package models

import "gorm.io/gorm"

type User struct { //用户
	gorm.Model
	Mobile   string `gorm:"type:char(11);not null"`
	Password string `gorm:"type:char(32);not null"`
	Name     string `gorm:"type:varchar(20);not null"`
	Image    string `gorm:"type:varchar(500);not null"`
}
type Novel struct { //小说
	gorm.Model
	Title        string `gorm:"type:varchar(20);not null"`
	Class        string `gorm:"type:varchar(20);not null"`
	Label        string `gorm:"type:varchar(50);not null"`
	Introduction string `gorm:"type:varchar(50);not null"`
	UserId       int    `gorm:"type:int(11);not null"`
	CollectCount int    `gorm:"type:int(11);not null"`
}
type Comment struct { //评论
	gorm.Model
	Content string `gorm:"type:varchar(100);not null"`
	UserId  int    `gorm:"type:int(11);not null"`
	NovelId int    `gorm:"type:int(11);not null"`
}
type Collect struct { //收藏
	gorm.Model
	NovelId int `gorm:"type:int(11);not null"`
	UserId  int `gorm:"type:int(11);not null"`
}
type NovelData struct {
	Novel
	Name  string `gorm:"type:varchar(20);not null"`
	Image string
}
type CollectData struct {
	Collect
	Novel
}
type NovelComment struct {
	Novel
	Content string
}
